/**
 * 皇位继承顺序
 * 继承规则同欧洲皇室
 **/

#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#include<hash_map>
using namespace std;

/**
 * Solution 1:用单向列表记录继承顺序，哈希表存储节点信息，标记删除
 * 具体思路见宫水三叶blog
 **/


class ThroneInheritance {
public:
    struct Node {
        string name;
        Node *next;
        Node *last;
        bool isDeleted = false;
        Node (string _name){
            name = _name;
        }
    };

    unordered_map<string, Node> map;
    Node *head = new Node("");
    Node *tail = new Node("");

    ThroneInheritance(string kingName) {
        Node *root = new Node(kingName);
        root->next = tail;
        head->next = root;
        map.emplace(kingName, root);
    }
    
    void birth(string parentName, string childName) {
        Node *node = new Node(childName);
        map.emplace(childName, node);

        Node pnode = map.find(parentName);


    }
    
    void death(string name) {

    }
    
    vector<string> getInheritanceOrder() {

    }
};

/**
 * Your ThroneInheritance object will be instantiated and called as such:
 * ThroneInheritance* obj = new ThroneInheritance(kingName);
 * obj->birth(parentName,childName);
 * obj->death(name);
 * vector<string> param_3 = obj->getInheritanceOrder();
 */
